CREATE TABLE [dbo].[Permission]
(
[PermissionId] [int] NOT NULL IDENTITY(1, 1),
[AccountId] [int] NOT NULL,
[AccessRoleId] [int] NOT NULL,
[CreatedDate] [datetime] NOT NULL,
[LastModifiedDate] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Permission] ADD CONSTRAINT [PK_Permission] PRIMARY KEY CLUSTERED  ([PermissionId]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Permission] ADD CONSTRAINT [FK_Permission_AccessRole] FOREIGN KEY ([AccessRoleId]) REFERENCES [dbo].[AccessRole] ([AccessRoleId])
GO
ALTER TABLE [dbo].[Permission] ADD CONSTRAINT [FK_Permission_Account] FOREIGN KEY ([AccountId]) REFERENCES [dbo].[Account] ([AccountId])
GO
